home *** CD-ROM | disk | FTP | other *** search
/ Palm Utilities / Palm_Utilities_CD-ROM_2001_2001.iso / files / utils misc / Bachmann Print Manager 2.01b / BachmannPrintManager.exe / SamplePrints / Src / Email.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-02  |  8.6 KB  |  274 lines

  1. #include "pms_main.h"
  2. #include "Email.h"
  3.  
  4.  
  5. /*
  6.    SampleEmail:
  7.    Prints out a dummy email (same output as a Eudora print)
  8.    Parms:    formP                    Parent form.
  9.    Return:    0                        Success.
  10.             -1                        Error.
  11. */
  12.  
  13. void
  14. SampleEmail (FormPtr formP)
  15. {
  16.    UInt err;
  17.    UInt refNum = 0;
  18.  
  19.  
  20.    // Load the library 
  21.    err = SampleLoad(formP, PageManager);
  22.   
  23.    
  24.    // Make sure refNum is not 0 (we should not be here if it is).
  25.    refNum = MainFormGetRefNum (formP);
  26.    ErrFatalDisplayIf ((refNum == 0), "Invalid state!");
  27.  
  28.  
  29.    // Open the printer
  30.    err = SampleOpen(formP, PageManager); 
  31.    ErrFatalDisplayIf ((err != 0), "Could not open printer");
  32.  
  33.    // Set the settings
  34.    SampleSettings(formP, PageManager);
  35.  
  36.    // Print the text
  37.    SamplePrintEmail( formP);
  38.  
  39.    // Close printer
  40.    SampleClose(formP, PageManager);
  41.  
  42.    // Unload the library
  43.    SampleUnload(formP);
  44.    
  45.  
  46. }
  47.    
  48.  
  49. /*
  50.    SamplePrintEmail:
  51.    Prints the text
  52.    Parms:       formP       Parent form.
  53.    Returns:       0           Success.
  54.                -1           Error.
  55. */
  56.  
  57.  
  58.  
  59. void
  60. SamplePrintEmail (FormPtr formP)
  61. {
  62.  
  63.    UInt refNum;
  64.    PagFontType font;
  65.  
  66.    
  67.    refNum = MainFormGetRefNum (formP);
  68.    ErrFatalDisplayIf ((refNum == 0), "Invalid state!");
  69.    
  70.    // Set font to Times Roman 14 bold.
  71.    StrCopy (font.typeface, "Times Roman");
  72.    font.height = 12;
  73.    font.bold = true;
  74.    font.italics = false;
  75.    PagSetFont (refNum, &font);   
  76.    
  77.    // Begin printing text.
  78.  
  79.    PagPrintText(refNum, "From:    ");
  80.    
  81.    StrCopy (font.typeface, "Courier");
  82.    font.height = 12;
  83.    font.bold = false;
  84.    font.italics = false;
  85.    PagSetFont (refNum, &font);  
  86.    
  87.    PagPrintText(refNum, "Jim Burrow <Jim@burrow.net>");
  88.    PagNewLine(refNum);
  89.  
  90.    StrCopy (font.typeface, "Times Roman");
  91.    font.height = 12;
  92.    font.bold = true;
  93.    font.italics = false;
  94.    PagSetFont (refNum, &font);   
  95.  
  96.    PagPrintText(refNum, "To:      ");
  97.  
  98.    StrCopy (font.typeface, "Courier");
  99.    font.height = 12;
  100.    font.bold = false;
  101.    font.italics = false;
  102.    PagSetFont (refNum, &font);
  103.  
  104.    PagPrintText(refNum, "\"John@davis.net\" <john@davis.net>");
  105.    PagNewLine(refNum);
  106.  
  107.    StrCopy (font.typeface, "Times Roman");
  108.    font.height = 12;
  109.    font.bold = true;
  110.    font.italics = false;
  111.    PagSetFont (refNum, &font);   
  112.  
  113.    PagPrintText(refNum, "Date:    ");
  114.  
  115.    StrCopy (font.typeface, "Courier");
  116.    font.height = 12;
  117.    font.bold = false;
  118.    font.italics = false;
  119.    PagSetFont (refNum, &font);
  120.  
  121.    PagPrintText(refNum, "Monday, August 30, 1999 3:32 PM");
  122.    PagNewLine(refNum);
  123.  
  124.    StrCopy (font.typeface, "Times Roman");
  125.    font.height = 12;
  126.    font.bold = true;
  127.    font.italics = false;
  128.    PagSetFont (refNum, &font);  
  129.  
  130.    PagPrintText(refNum, "Subject: ");
  131.  
  132.    StrCopy (font.typeface, "Courier");
  133.    font.height = 12;
  134.    font.bold = false;
  135.    font.italics = false;
  136.    PagSetFont (refNum, &font);   
  137.  
  138.    PagPrintText(refNum, "re: How do I print from Palm OS?");
  139.  
  140.    PagNewLine(refNum);
  141.    PagNewLine(refNum);
  142.    PagNewLine(refNum);
  143.  
  144.    // Begin printing body
  145.  
  146.    PagPrintLine(refNum, "John,");
  147.    PagNewLine(refNum);
  148.    PagPrintLine(refNum, ">From your previous email it seems that you're in need of Bachmann Print");
  149.    PagPrintLine(refNum, "Manager.  Check out http://www.bachmannsoftware.com.  Here is a blurb from");
  150.    PagPrintLine(refNum, "their page:");
  151.    PagNewLine(refNum);
  152.  
  153.    StrCopy (font.typeface, "Times Roman");
  154.    font.height = 12;
  155.    font.bold = true;
  156.    font.italics = false;
  157.    PagSetFont (refNum, &font);  
  158.  
  159.    PagPrintLine(refNum, "Why Print from the Palm Computing Platform?");
  160.    PagNewLine(refNum);
  161.  
  162.    StrCopy (font.typeface, "Courier");
  163.    font.height = 12;
  164.    font.bold = false;
  165.    font.italics = false;
  166.    PagSetFont (refNum, &font); 
  167.  
  168.    PagPrintLine(refNum, "The Palm Connected Organizer is a great device for helping mobile workers");
  169.    PagPrintLine(refNum, "and other users on the go gain access to critical information when and");
  170.    PagPrintLine(refNum, "where they need it.  But handheld devices have a limited display area, and");
  171.    PagPrintLine(refNum, "even handheld applications require the ability to quickly and easily print");
  172.    PagPrintLine(refNum, "information in a rich graphical format.  Receipts, forms, reports, e-mails,");
  173.    PagPrintLine(refNum, "directions, maps, and spreadsheets all need to be printed from time to time");
  174.    PagPrintLine(refNum, "in order to give information to another person, produce a record of a");
  175.    PagPrintLine(refNum, "transaction, or to ciew information in a larger, more easily readable format.");
  176.  
  177.    StrCopy (font.typeface, "Times Roman");
  178.    font.height = 12;
  179.    font.bold = true;
  180.    font.italics = false;
  181.    PagSetFont (refNum, &font);  
  182.  
  183.    PagNewLine(refNum);
  184.    PagPrintLine(refNum, "What is Bachmann Print Manager?");
  185.    PagNewLine(refNum);
  186.  
  187.    StrCopy (font.typeface, "Courier");
  188.    font.height = 12;
  189.    font.bold = false;
  190.    font.italics = false;
  191.    PagSetFont (refNum, &font); 
  192.  
  193.    PagPrintLine(refNum, "Bachmann Print Manager gives Palm Computing Platform application developers");
  194.    PagPrintLine(refNum, "the power to create stunning printed output directly from their Palm Pilot");
  195.    PagPrintLine(refNum, "application.  Now, with Bachmann Print Manager, you can print any");
  196.    PagPrintLine(refNum, "information from your Palm Connected Organizer, using either a serial or");
  197.    PagPrintLine(refNum, "infrared connection to popular portable, standalone, or networked printers.");
  198.    PagPrintLine(refNum, "There is no longer any need to synchronize data back to the desktop in");
  199.    PagPrintLine(refNum, "order to create printed output that is of the caliber youw ould expect from");
  200.    PagPrintLine(refNum, "a Windows application.");
  201.    PagNewLine(refNum);
  202.    PagPrintLine(refNum, "Bachmann Print Manager is a standard Palm OS Shared Library, so it is");
  203.    PagPrintLine(refNum, "easily and tightly integrated with any Palm Pilot application.  Both");
  204.    PagPrintLine(refNum, "Metrowerks CodeWarrior and GCC environments are supported for development.");
  205.    PagNewLine(refNum);
  206.    PagNewLine(refNum);
  207.  
  208.    StrCopy (font.typeface, "Times Roman");
  209.    font.height = 12;
  210.    font.bold = true;
  211.    font.italics = false;
  212.    PagSetFont (refNum, &font);  
  213.  
  214.    PagPrintLine(refNum, "What HandHeld/Mobile Applications need Bachmann Print Manager?");
  215.  
  216.    StrCopy (font.typeface, "Courier");
  217.    font.height = 12;
  218.    font.bold = false;
  219.    font.italics = false;
  220.    PagSetFont (refNum, &font); 
  221.  
  222.    PagNewLine(refNum);
  223.    PagPrintLine(refNum, "Personal Information Management");
  224.    PagPrintLine(refNum, "E-mail and other internet applications");
  225.    PagPrintLine(refNum, "Mapping/GPS software");
  226.    PagPrintLine(refNum, "Sales Force Automation");
  227.    PagPrintLine(refNum, "Reporting");
  228.    PagPrintLine(refNum, "Manufacturing");
  229.    PagPrintLine(refNum, "Retail Sales");
  230.    PagPrintLine(refNum, "Your Application");
  231.  
  232.    PagNewLine(refNum);
  233.  
  234.    StrCopy (font.typeface, "Times Roman");
  235.    font.height = 12;
  236.    font.bold = true;
  237.    font.italics = false;
  238.    PagSetFont (refNum, &font);  
  239.  
  240.    PagPrintLine(refNum, "Bachmann Print Manager Features");
  241.  
  242.    StrCopy (font.typeface, "Courier");
  243.    font.height = 12;
  244.    font.bold = false;
  245.    font.italics = false;
  246.    PagSetFont (refNum, &font); 
  247.  
  248.    PagNewLine(refNum);
  249.  
  250.    PagPrintLine(refNum, "WYSIWYG print engine for Palm OS");
  251.    PagPrintLine(refNum, "Draw rectangles, lines, proportional fonts, bitmaps and more!");
  252.    PagPrintLine(refNum, "Infrared and serial printing capability for custom and commercial");
  253.    PagPrintLine(refNum, "application developers.");
  254.    PagPrintLine(refNum, "English-like C/C++ application programming interface");
  255.    PagPrintLine(refNum, "Extremely small memory footprint");
  256.    PagPrintLine(refNum, "Fast! Bachmann Print Manager is optimized for speed!");
  257.    PagPrintLine(refNum, "Employs printer driver model familiar to Windows programmers");
  258.    PagPrintLine(refNum, "Supports standard IrDA_enabled printers");
  259.    PagPrintLine(refNum, "Transparently prints via infrared or serial connection by changing one");
  260.    PagPrintLine(refNum, "simple setting");
  261.    PagPrintLine(refNum, "Uses Shared Library interface already familiar to Palm developers.");
  262.    PagPrintLine(refNum, "Bachmann Print Library comes with electronic documentation and sample code");
  263.    PagPrintLine(refNum, "to enable the fastest possible integration of printing with your application!");
  264.  
  265.    PagNewLine(refNum);
  266.  
  267.    PagNewLine(refNum);
  268.  
  269.    PagPrintLine(refNum, "I hope this answered any questions you may have had.");
  270.    PagNewLine(refNum);
  271.    PagPrintLine(refNum, "Jim Burrow");
  272.  
  273.  
  274. }